﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace OConf.Entity
{
    [Table("Admins")]
    public class AdminsEntity
    {
        /// <summary>
        /// id
        /// </summary>
        [Key, Column(TypeName = "varchar(50)"), Required, MaxLength(50)]
        public string ID { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [Column(TypeName = "varchar(20)"), Required, MaxLength(20)]
        public string AccountNumber { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(TypeName = "varchar(255)"), Required, MaxLength(255)]
        public string Password { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column(TypeName = "varchar(20)"), MaxLength(20)]
        public string UserName { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [Column(TypeName = "varchar(50)"), MaxLength(50)]
        public string Email { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "datetime"), Required]
        public DateTime Createtime { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        [Column(TypeName = "tinyint(1)"), Required]
        public bool Enable { get; set; }

        /// <summary>
        /// 用户角色（1系统管理员，2超级管理员，3普通管理员）
        /// </summary>
        [Column(TypeName = "int"), Required]
        public int RoleType { get; set; }
    }

    /// <summary>
    /// 用户角色枚举
    /// </summary>
    public enum RoleTypeEnum
    {
        系统管理员 = 1,
        超级管理员 = 2,
        普通管理员 = 3
    }
}
